<?php

include_once 'conn.php';
if(!empty($_POST['post'])){
    $username = $_POST['username'];
    $email = $_POST['email'];
    $content = $_POST['content'];   
    
   $sql = "insert into reply ( id,username,email,contet) values ( null, '$username','$email','$content')";
   $result = $conn->query($sql);
  
   
     if($result === TRUE){
         echo "<script type'text/javascript'>alert('留言成功！');location.href='index.php'</script>";
     }  else {
         echo "<script type'text/javascript'>alert('留言失败！');location.href='index.php'</script>";    
     }
}
?>